/*
 * LectorAritmetico.h
 *
 *  Created on: 06/04/2012
 *      Author: lucas
 */

#ifndef LECTORARITMETICO_H_
#define LECTORARITMETICO_H_

#include <stdio.h>

class LectorAritmetico {
public:
	unsigned short leerSimbolo(unsigned short* largos, unsigned short total,
			unsigned short cantidad);
	LectorAritmetico(FILE* archivo);
	virtual ~LectorAritmetico();
private:
	FILE* archivo;
	FILE* archivoDebug;
	unsigned int piso;
	unsigned int techo;
	unsigned int limite;
	unsigned int underflow;
	unsigned char* buffer;
	unsigned int posicion;
	unsigned int contadorBuffer;
	unsigned int contadorSubBuffer;
	static unsigned int tamanioBuffer;
	static unsigned int precision;
	void renormalizar();
	void leerBitsDeBuffer(unsigned int cantidadDeBits);
	void leerBufferDeArchivo();
};

#endif /* LECTORARITMETICO_H_ */
